var Filter = {
	
	mvc: {},
	url: { root:'', database:'' },				
	
	action : function(data){	
		
		var ul = $('<ul />').appendTo('#content')
		var params, htm

			for (var x = 0; x < data.length; x++) {				
				params = {
					'name': data[x].Nome,
					'content': 
						data[x].Sobrenome + "<br />" + data[x].Idade + "<br />" + data[x].Sexo
				}
														
				htm =  Filter.mvc.View.html(params)					
				$('<li />').append(htm).appendTo(ul)
			}
						
	},	
	
	init : function(root, database){
		
		Filter.mvc = new MVC
		
		this.url.root = root
		this.url.database = database

		MVC.scaffold({
			url : this.url.database,
			parameters: {
				'nome' : ['Eduardo', "Flavia", "Lourdes"],
				'sobrenome' : ['Ottaviani', 'Aragão'],
				'sexo' : 'Masculino',
				'idade' : '25'
			}
		})
				
		Filter.mvc.Controller.callback =  this.action 						
		Filter.mvc.View.template( 'template.htm',  Filter.mvc.Controller.request )
			
	}	
		
}	

Filter.init('/', 'json.js')

	
